[HttpPost]
public ActionResult Split_Str()
{
string Str = "18/06/2019 00:00:00";
string[] Split_Str_Array = Str.Split(new char[1] { '/' },3);
string[] Split_Str_Arrays=Split_Str_Array[2].Split(new char[1] { ' ' }, 2);
string Split_Str = Split_Str_Arrays[0] +"-"+ Split_Str_Array[1]
+"-"+ Split_Str_Array[0]+"T"+ Split_Str_Arrays[1];
Response.Write("<script language=javascript>alert('" + Split_Str + "');</"
+ "script>");
return View("Index");
}
<style>
.split-button {
margin: 60px 0 0 50px;
}
</style>
@using (Html.BeginForm("Split_Str", "Home", FormMethod.Post,new{enctype="multipart/form-data"}))
{
<div class="split-button">
<button class="btn btn-primary" id="split-button">Click</button>
</div>
}